import PAGE from '../../utils/middleware/page'
Page(PAGE({
    data: {
        contact: {},
        apiField: {
            module: 'common',
            api: 'GetSetting',
            data: 'contact',
            search: {
                code: 'Contact'
            }
        }
    },
    onLoad(options) {
        this.fetchData()
    },
    async fetchData() {
        await this.handleFetchData({}, 'apiField', true)
        wx.makePhoneCall({
            phoneNumber: this.data.phone,
        })
    },
    handleCallPhone() {
        wx.makePhoneCall({
            phoneNumber: this.data.contact.Phone
        })
    },
    handleSavePhone() {
        wx.addPhoneContact({
            firstName: '停车',
            middleName: this.data.contact.Phone
        })
    },
    handlePreview(e) {
        wx.previewImage({
            urls: [this.data.contact.Qrcode],
        })
    },
}))